/*
 *  FXNoDeleter.h
 *
 *  Copyright 2015 https://github.com/dqjl111 All rights reserved.
 *
 *  This program is use for fuxi project
 *
 *  Created  by: Zhipeng Lin on 2016-01-30
 *  Modified by: Zhipeng Lin on 2016-01-30
 *  ************************************************************************************ */
#ifndef FXNoDeleter
#define FXNoDeleter
/// NoDeleter is a customised deleter intended for use with smart pointers.
#include "base/FXStdafx.h"

namespace fx{
class NoDeleter
{
public:
  void operator() (const void *) {}
};

/// Helper function to construct shared pointer with NoDeleter with cleaner syntax

template <typename T>
std::shared_ptr<T> noDeletePtr(T& r)
{
  return std::shared_ptr<T>(&r, NoDeleter());
}
}
#endif // FXNoDeleter

